package jellyfishumbrella.tikis;

import com.jellyfishumbrella.GL.Material;
import com.jellyfishumbrella.GL.RendererGL;
import com.jellyfishumbrella.GL.Surface;

public class Surfaces {
	
	public static void setup(){
		setupDefaultSurface();
		setupOceanSurface();
		setupBeachSurface();
		setupLavaSurface();
	}

	public static void setupDefaultSurface() {
		Surface currSurface = new Surface("default");
		float[] amb = { 0.3f, 0.3f, 0.3f, 1.0f };
		float[] diff = { 1.0f, 1.0f, 1.0f, 1.0f };
		float[] spec = { 1.0f, 1.0f, 1.0f, 1.0f };
		float gloss = 60.0f;

		String[] shaderFiles = new String[2];

		shaderFiles[0] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/selectableLitMultiTexture.vert";
		shaderFiles[1] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/selectableLitMultiTexture.frag";

		currSurface.textures.add(RendererGL.textureHash.get("test_ALT_GRAD"));
		currSurface.textures.add(RendererGL.textureHash.get("testFractal_Noise"));

		currSurface.setupMaterial(new Material(amb, diff, spec, gloss), shaderFiles);
		// materials[i] = new Material(amb, diff, spec, gloss);
		// shaderFiles[i][0] =
		// "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/starter.vert";
		// shaderFiles[i][1] =
		// "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/starter.frag";
		// shaderFiles[i][0] =
		// "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.vert";
		// shaderFiles[i][1] =
		// "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.frag";
		// shaderFiles[i][0] =
		// "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/selectableLitMultiTexture.vert";
		// shaderFiles[i][1] =
		// "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/selectableLitMultiTexture.frag";

		// }
		RendererGL.surfaceHash.put(currSurface.name, currSurface);
	}

	public static void setupOceanSurface() {
		Surface currSurface = new Surface("ocean");
		float[] amb = { 0.0f, 0.1f, 0.5f, 1.0f };
		float[] diff = { 0.0f, 0.2f, 1.0f, 1.0f };
		float[] spec = { 1.0f, 1.0f, 1.0f, 1.0f };
		float gloss = 60.0f;

		String[] shaderFiles = new String[2];
		shaderFiles[0] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.vert";
		shaderFiles[1] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.frag";
		
		currSurface.setupMaterial(new Material(amb, diff, spec, gloss), shaderFiles);

		RendererGL.surfaceHash.put(currSurface.name, currSurface);
	}

	public static void setupBeachSurface() {
		Surface currSurface = new Surface("beach");
		float[] amb = { 0.35f, 0.25f, 0.0f, 1.0f };
		float[] diff = { 0.7f, 0.5f, 0.0f, 1.0f };
		float[] spec = { 1.0f, 1.0f, 1.0f, 1.0f };
		float gloss = 60.0f;

		String[] shaderFiles = new String[2];
		shaderFiles[0] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.vert";
		shaderFiles[1] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.frag";
		
		currSurface.setupMaterial(new Material(amb, diff, spec, gloss), shaderFiles);

		RendererGL.surfaceHash.put(currSurface.name, currSurface);
	}

	public static void setupLavaSurface() {
		Surface currSurface = new Surface("lava");
		float[] amb = { 0.35f, 0.15f, 0.0f, 1.0f };
		float[] diff = { 0.9f, 0.3f, 0.0f, 1.0f };
		float[] spec = { 1.0f, 1.0f, 1.0f, 1.0f };
		float gloss = 60.0f;

		String[] shaderFiles = new String[2];
		shaderFiles[0] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.vert";
		shaderFiles[1] = "../GLEngine/src/com/jellyfishumbrella/GL/Shaders/litPolyColor.frag";
		
		currSurface.setupMaterial(new Material(amb, diff, spec, gloss), shaderFiles);

		RendererGL.surfaceHash.put(currSurface.name, currSurface);
	}
}
